<template>
  <div class="error-container">
    <div class="error-content">
      <div class="error-image">
        <svg
          width="300"
          height="200"
          viewBox="0 0 300 200"
          xmlns="http://www.w3.org/2000/svg"
        >
          <!-- 404图标 -->
          <text x="150" y="100" text-anchor="middle" class="error-number">404</text>
          <text x="150" y="130" text-anchor="middle" class="error-text">页面不存在</text>
        </svg>
      </div>
      
      <div class="error-info">
        <h1>抱歉，页面不存在</h1>
        <p>您访问的页面可能已被删除、重命名或暂时不可用。</p>
        
        <div class="error-actions">
          <a-button type="primary" @click="goHome">
            <template #icon>
              <icon-home />
            </template>
            返回首页
          </a-button>
          <a-button @click="goBack">
            <template #icon>
              <icon-left />
            </template>
            返回上页
          </a-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

// 返回首页
const goHome = () => {
  router.push('/')
}

// 返回上一页
const goBack = () => {
  window.history.back()
}
</script>

<style lang="scss" scoped>
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
}

.error-content {
  text-align: center;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 60px 40px;
  max-width: 500px;
  width: 100%;
}

.error-image {
  margin-bottom: 40px;

  .error-number {
    font-size: 48px;
    font-weight: bold;
    fill: #165dff;
  }

  .error-text {
    font-size: 16px;
    fill: #86909c;
  }
}

.error-info {
  h1 {
    font-size: 24px;
    color: #1d2129;
    margin-bottom: 16px;
    font-weight: 600;
  }

  p {
    color: #86909c;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 32px;
  }
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .error-content {
    padding: 40px 20px;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}
</style> 